<?php
/**
 * Render blog platform
 * @author Tuong Tran <tuong.tran@outlook.com>
 */
class UserModule extends CWebModule {
    public $layoutPath = '';

    public function init() {
        // this method is called when the module is being created
        // you may place code here to customize the module or the application
        // import the module-level models and components
        //$this->setImport(array(
        //    'backend.modules.cms.models.*',
        //));

        $this->defaultController = 'profile';
    }

    public function beforeControllerAction($controller, $action) {
        if (parent::beforeControllerAction($controller, $action)) {
            //check access and more


            //set default layout
            if($this->layoutPath == ''){
                $this->layoutPath = Yii::getPathOfAlias('application.views.layouts');
            }

            $this->setLayoutPath($this->layoutPath);

            return true;
        }
        else
            return false;
    }
}
